home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 020a / dvpt20.zip / EMBEDDED.C < prev    next >
C/C++ Source or Header  |  1991-12-12  |  2KB  |  71 lines

  1. /****************************************************************/
  2. /*                                                              */
  3. /*             Digitized Voice Programmer's Toolkit             */
  4. /*             ------------------------------------             */
  5. /*                                                              */
  6. /*                 Embedded voice data example                  */
  7. /*                                                              */
  8. /*            Copyright (c) 1991, Farpoint Software             */
  9. /*                                                              */
  10. /****************************************************************/
  11.  
  12. #include "vpmod.h"
  13.  
  14. #include <stdlib.h>
  15. #include <stdio.h>
  16.  
  17. /*-------------------------------------------------------------------*/
  18.  
  19. extern unsigned char EMB_DATA;       /* voice data array from ASM program */
  20. extern unsigned int EMB_DATA_SIZE;   /* length of the array */
  21.  
  22. char logo[] = "Embedded Digitized Voice Playback Test Program\r\n"
  23.  "Copyright(c) 1991, Farpoint Software\r\n";
  24.  
  25. /*-------------------------------------------------------------------*/
  26.  
  27. void main(void)
  28.  
  29. {
  30. int delayctr;                    /* internal timing delay from PCALIBRATE */
  31. int calflag;                     /* status word returned from PCALIBRATE */
  32. long retval;
  33.  
  34. /* display the logo */
  35.  
  36. puts(logo);
  37.  
  38. /* calibrate for CPU speed */
  39.  
  40. puts("Calibrating...");
  41. retval = PCALIBRATE();
  42. calflag = (int)(retval & 0xFFFF);
  43. delayctr = (int)(retval >> 16);
  44. switch ( calflag )
  45.     {
  46.     case 1:
  47.         puts("This computer is too slow to perform adequately with this program.");
  48.         printf("Speed rating = %d    Minimum = 64\n", delayctr);
  49.         exit(1);
  50.     case 2:
  51.         puts("This program will not function properly under Enhanced-mode Microsoft Windows.");
  52.         exit(1);
  53.     case 3:
  54.         puts("Unusual speaker circuit detected; proper operation is uncertain.");
  55.         break;
  56.     }
  57.  
  58. /* inform the user */
  59.  
  60. puts("Press any key to stop.");
  61. puts("Starting...");
  62.  
  63. /* perform the playback */
  64.  
  65. PLAYVOICE(&EMB_DATA, (long)EMB_DATA_SIZE);
  66.  
  67. /* finished */
  68.  
  69. puts("Done.");
  70. }
  71.